//
//  WaterwayViewController.m
//  mhome
//
//  Created by 刘春雷 on 2018/11/29.
//  Copyright © 2018年 刘春雷. All rights reserved.
//

#import "WaterwayViewController.h"

@interface WaterwayViewController ()
@property(nonatomic,strong)UIScrollView *scroll;
@end

@implementation WaterwayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"水路工程";
    self.scroll = [[UIScrollView alloc]initWithFrame:CGRects(0, 0, 375, 667)];
    self.scroll.contentSize = CGSizeMake(0 , 1560*kHeightScale);
    self.scroll.backgroundColor = [UIColor whiteColor];
    self.scroll.pagingEnabled = NO;//是否允许整也翻
    self.scroll.bounces = NO;//关闭弹簧效果
    self.scroll.showsVerticalScrollIndicator = NO;//是否显示垂直滚动条
    [self.view addSubview:self.scroll];
    [self setUI];
}
- (void)setUI {
    UIImageView*headImage=[[UIImageView alloc] initWithFrame:CGRects(0, 0, 375, 135)];
    headImage.backgroundColor = [UIColor grayColor];
    headImage.image=[UIImage imageNamed:@"construct-ban"];
    [self.scroll addSubview:headImage];
    for(int i = 0; i< 5;i++){
        UILabel*title=[[UILabel alloc ] init];
        title.font=[UIFont systemFontOfSize:20.0*BIZ];//字体大小
        [self.scroll addSubview:title];
        UILabel*content=[[UILabel alloc] init];
        content.numberOfLines = 0;
        content.font=[UIFont systemFontOfSize:13.0*BIZ];//字体大小
        content.textColor=[UIColor grayColor];
        [self.scroll addSubview:content];
        UIImageView*imgOne=[[UIImageView alloc] init];
        [self.scroll addSubview:imgOne];
        if(i == 0){
            title.frame = CGRects(15, 170, 300, 30);
            title.text=@"PPR水管走向要求";
            content.frame = CGRects(15, 200, 345, 120);
            content.text= @" ● PPR水管走向要求\n ● 水管走向应遵循“横平竖直”“走顶走墙不走地”原则。\n ● 冷热水管间距≥150mm;特殊情况下（淋浴房除外);冷热水 管间距可≥30mm。\n ● 水管敷设应遵循“左热右冷”原则。";
            imgOne.frame = CGRects(20, 320, 335, 140);
            imgOne.image=[UIImage imageNamed:@"water1"];
        }else if(i == 1){
            title.frame = CGRects(15, 460, 300, 30);
            title.text=@"PPR水管固定工艺";
            content.frame = CGRects(15, 490, 345, 120);
            content.text= @" ● 水管应用吊卡固定,固定间距≤800mm。\n ● 水管在顶面转角固定时,吊卡与转角处间距≤150mm。\n ● 顶面明敷水管交叉时可用高低差来调节,不宜使用过桥弯。\n ● 明管敷设时,热水管应用保温材料保护;冷水管根据需求实施保护措施。 ";
            imgOne.frame = CGRects(20, 610, 335, 140);
            imgOne.image=[UIImage imageNamed:@"water2"];
        }else if(i == 2){
            title.frame = CGRects(15, 770, 300, 30);
            title.text=@"PPR水管安装验收";
            content.frame = CGRects(15, 800, 345, 50);
            content.text= @" ● 高层打压0.8Mpa,多层打压0.6 Mpa,水压稳定后半小时内下降不大于0.05MPa为合格。";
            imgOne.frame = CGRects(20, 850, 335, 140);
            imgOne.image=[UIImage imageNamed:@"water3"];
        }else if (i == 3) {
            title.frame = CGRects(15, 1010, 300, 30);
            title.text=@"新老排水管连接工艺";
            content.frame = CGRects(15, 1040, 345, 40);
            content.text= @" ● 排水管与下水连接时（排水管低于完成面）,应在原接口处增加固定配件,防止渗水。";
            imgOne.frame = CGRects(20, 1080, 335, 140);
            imgOne.image=[UIImage imageNamed:@"water4"];
        }else {
            title.frame = CGRects(15, 1240, 300, 30);
            title.text=@"排水管与地漏连接要求";
            content.frame = CGRects(15, 1270, 345, 40);
            content.text= @" ● 排水管与地漏连接时,地漏应塞进排水管内。";
            imgOne.frame = CGRects(20, 1310, 335, 140);
            imgOne.image=[UIImage imageNamed:@"water5"];
        }
        //改变label的间边距
        NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:content.text];
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
        [paragraphStyle setLineSpacing:6];
        [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [content.text length])];
        content.attributedText = attributedString;
    }
}
- (void)btns {
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
